/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
    transform: translateY(-1px);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
}

.btn-success {
    background: linear-gradient(135deg, #198754, #146c43);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #b02a37);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ffcd39);
}

.btn-info {
    background: linear-gradient(135deg, #0dcaf0, #31d2f2);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toast 样式 */
.position-fixed {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 进度条样式 */
.progress {
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.6s ease;
    font-weight: 600;
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position-x: 1rem;
    }
}

/* 表格样式 */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: linear-gradient(135deg, #212529, #343a40);
    color: white;
    font-weight: 600;
    border: none;
}

.table td {
    vertical-align: middle;
    border-color: #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* 表单样式 */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
}

.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 徽章样式 */
.badge {
    font-size: 0.85em;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* 警告框样式 */
.alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* 首页样式 */
.jumbotron {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
}

.display-4 {
    font-weight: 700;
    color: #212529;
}

.lead {
    font-size: 1.25rem;
    color: #6c757d;
}

/* 状态指示器 */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-online {
    background-color: var(--success-color);
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.5);
}

.status-offline {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.status-unknown {
    background-color: var(--secondary-color);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 代码样式 */
code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

/* 模态框样式 */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* 页脚样式 */
footer {
    margin-top: auto;
}

/* 工具提示增强 */
.tooltip {
    font-size: 0.9rem;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 测试按钮动画 */
.test-server-btn.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 成功状态 */
.test-server-btn.btn-success {
    background: linear-gradient(135deg, #198754, #146c43);
    border-color: #198754;
}

/* 失败状态 */
.test-server-btn.btn-danger {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    border-color: #dc3545;
}

/* 调试信息面板 */
#debugInfo {
    font-size: 0.8rem;
}

#debugContent {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 状态颜色类 */
.text-completed { color: var(--success-color); }
.text-failed { color: var(--danger-color); }
.text-pending { color: var(--secondary-color); }
.text-processing { color: var(--info-color); }

.bg-completed { background-color: var(--success-color); }
.bg-failed { background-color: var(--danger-color); }
.bg-pending { background-color: var(--secondary-color); }
.bg-processing { background-color: var(--info-color); }
